home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
.net 2002 March
/
DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin
/
pc
/
PC Software
/
free_browsing
/
DavesQckSearchDbar3-14
/
dqsd.exe
/
searches
/
timer.xml
< prev
next >
Wrap
Text File
|
2002-08-30
|
2KB
|
60 lines
<search function="timer">
<name>Countdown Timer with Alarm</name>
<description>
Set a countdown timer with alert for x number of minutes.<br/>
<div class="helpboxDescLabels">Usage:</div>
<table class="helpboxDescTable">
<tr><td>Set Timer</td><td> - </td><td>timer <<i>minutes</i>> [<<i>message</i>>]</td></tr>
<tr><td>Cancel Timer</td><td> - </td><td>timer cancel</td></tr>
</table>
<div class="helpboxDescLabels">Examples:</div>
<table class="helpboxDescTable">
<tr><td>timer 60 Do status</td></tr>
<tr><td>timer cancel</td></tr>
</table>
</description>
<category>Functions</category>
<contributor>Monty Scroggins</contributor>
<script><![CDATA[
var timernum;
function timer(t)
{
if( nullArgs("timer",t) )
return false;
if (t != "" )
{
var parsed = t.split(" ");
var time = parsed.shift();
if (time.match(/cancel/))
{
clearInterval(timernum);
document.deff.q.value="Timer Canceled..";
setTimeout("document.deff.q.value='';",1000);
return;
}
if(! time.match(/^\.*\d+$/) )
{
window.alert("Bad minutes '" + time + "' entered.. should be \'timer <minutes> <message>\'");
return;
}
var timermsg = 'Timer Expired';
if( parsed[0] != null && parsed[0].length != 0 )
{
timermsg = parsed.join(' ');
}
document.deff.q.value = "Timer Set..";
setTimeout("document.deff.q.value='';",1000);
timernum = setTimeout("window.alert('" + timermsg + "');",time*1000*60);
}
}//end function
]]></script>
<copyright>
Copyright (c) 2002 David Bau
Distributed under the terms of the
GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
</copyright>
</search>